package group.program.Controller;

import group.program.Service.DatabaseService;
import group.program.pojo.trafficPojo.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
@RequestMapping("Database")
@RestController
public class DatabaseController {
    @Autowired
    private DatabaseService databaseService;
    @GetMapping("AddDatabase")
    public Result AddDatabase(String name, String url, String username, String password){
        databaseService.addDatabase(name, url, username, password);
        return Result.success();
    }
    @GetMapping("RemoveDatabase")
    public Result RemoveDatabase(String name,String url,String username,String password){
        databaseService.removeDatabase(name, url, username, password);
        return Result.success();
    }
}
